#ifndef MODULEELECTRONICSCALEDEFINE_H
#define MODULEELECTRONICSCALEDEFINE_H

#include <qglobal.h>
#include <QList>
#include <QObject>


namespace electronicscale
{

enum WeightUnit
{
    WeightUnit_g = 0,
    WeightUnit_ct,

    _WeightUnit_Max,
};

struct Weight
{
    double          value = 0;
    WeightUnit      unit = _WeightUnit_Max;
};

struct Sample
{
    qint64          time = 0;
    Weight          weight;
};

struct ElectronicScaleParam
{
    QList<Sample>     samples;
};

enum WeightRateUnit
{
    WeightRateUnit_g_h = 0,
    WeightRateUnit_ct_h,

    _WeightRateUnit_Max,
};

struct WeightRate
{
    double            currentWeight = 0;
    double            value = 0;
    WeightRateUnit    unit = _WeightRateUnit_Max;
};

struct IntervalRate
{
    qint64          time = 0;
    WeightRate      rate;
};

}
Q_DECLARE_METATYPE(electronicscale::Sample)
Q_DECLARE_METATYPE(QList<electronicscale::Sample>)
Q_DECLARE_METATYPE(electronicscale::ElectronicScaleParam)
Q_DECLARE_METATYPE(electronicscale::IntervalRate)
Q_DECLARE_METATYPE(QList<electronicscale::IntervalRate>)

#endif // MODULEELECTRONICSCALEDEFINE_H
